﻿using System;
using System.IO;
using System.Reflection;

namespace Needle.Bus.Tests.Configuration
{
    public class TestData
    {
        public static Stream GetStream(string name)
        {
            return Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(TestData), name);
        }

        public static TextReader GetTextReader(string name)
        {
            return new StreamReader(GetStream(name));
        }

        public static string GetString(string name)
        {
            using (var reader = new StreamReader(GetStream(name)))
            {
                return reader.ReadToEnd();
            }  
        }

    }
}
